package com.test.task.service;

import com.test.task.beans.User;
import com.test.task.dao.AdminDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @DATE 2021/6/21 - 16:39
 */
@Service
public class AdminServiceImpl implements AdminService{
    @Autowired
    private AdminDao adminDao;
    @Override
    public Integer addStaff(User user) {
        return adminDao.insertStaff(user);
    }

    @Override
    public List<User> queryAllStaff() {
        return adminDao.selectAllStaff();
    }

    @Override
    public User findStaffByUsername(String username) {
        return adminDao.selectStaffByUsername(username);
    }

    @Override
    public Integer deleteStaffByUsername(String username) {
        return adminDao.deleteStaffByUsername(username);
    }

    @Override
    public List<User> findNotAllocatedStaff() {
        return adminDao.selectNotAllocatedStaff();
    }

    @Override
    public List<User> findAllManager() {
        return adminDao.selectAllManager();
    }

    @Override
    public Integer allocatedDeptByUsername(User user) {
        return adminDao.allocatedDeptByUsername(user);
    }
}
